#ifndef _BUOLA_MEDIA_VIDEO_B1394SOURCE_H_
#define _BUOLA_MEDIA_VIDEO_B1394SOURCE_H_

#include <buola/config.h>

#ifndef BUOLA_HAVE_DC1394
    #error "dc1394 not supported in this build of buola"
#endif

#include <buola/bbox/bservice.h>
#include <buola/bbox/bdataout.h>
#include <buola/image/format.h>

#include <dc1394/control.h>

namespace buola { namespace media {

class B1394Source : public bbox::BService<B1394Source>
{
    struct SImpl;

public:
    B1394Source(int pNum,const std::string &pName);
    ~B1394Source();

public:
    void ThreadCB();

private:
    virtual void DoInitialize();
    virtual void DoActivate();
    virtual void DoDeactivate();

private:
    int mCamNumber;
    bool mDone;
    CDC1394Camera *mCamera;

public:
    bbox::BDataOut<img::CImage_rgb8> oImage;
};

/*namespace media*/ } /*namespace buola*/ }

#endif
